home *** CD-ROM | disk | FTP | other *** search
/ Dos/V Magazine 1995 October 15 / CD [VMAG951015].bin / _demo / w95demo / shared.dir / 00382_DIALOG CALLING SCRIPTS.ls < prev    next >
Encoding:
Text File  |  1995-08-22  |  11.0 KB  |  374 lines

  1. on dialogOpen d
  2.   global gDialogWindow, gLastAudio
  3.   set gLastAudio to EMPTY
  4.   sound stop 1
  5.   if objectp(gDialogWindow) then
  6.     forget(gDialogWindow)
  7.   end if
  8.   set gDialogWindow to window "dw"
  9.   set the fileName of gDialogWindow to "Mdialogs.DIR"
  10.   set mywindowrect to rect(1, 1, 2, 2)
  11.   set the rect of gDialogWindow to mywindowrect
  12.   set the windowType of gDialogWindow to 2
  13.   set the modal of gDialogWindow to 1
  14.   set the titleVisible of gDialogWindow to 0
  15.   set the visible of gDialogWindow to 0
  16.   moveToBack(gDialogWindow)
  17.   open(gDialogWindow)
  18.   tell gDialogWindow
  19.     go(d)
  20.     set w to dialogwidth()
  21.     set ht to dialogHeight()
  22.   end tell
  23.   set h to the stageLeft + 320 - (w / 2)
  24.   set v to the stageTop + 240 - (ht / 2)
  25.   set mywindowrect to rect(h, v, h + w - 2, v + ht - 2)
  26.   set the rect of gDialogWindow to mywindowrect
  27.   set the visible of gDialogWindow to 1
  28.   moveToFront(gDialogWindow)
  29.   updateStage()
  30. end
  31.  
  32. on dialogClose
  33.   global gDialogWindow
  34.   if objectp(gDialogWindow) then
  35.     set the modal of gDialogWindow to 0
  36.     set the visible of gDialogWindow to 0
  37.     puppetSprite(48, 0)
  38.     forget(gDialogWindow)
  39.     updateStage()
  40.     if (the movie = "M08CHBKG.DIR") and (the frameLabel = "end") then
  41.       drawPaper()
  42.     end if
  43.   end if
  44. end
  45.  
  46. on timeOutResellerDialog
  47.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gAutoMode, gMainMovieName
  48.   if gDialogResult = EMPTY then
  49.     set gDialogCallback to "timeOutResellerDialog"
  50.     set gDialogResult to EMPTY
  51.     set gLastTimeoutScript to the timeoutScript
  52.     set gLastTimeoutLength to the timeoutLength
  53.     set the timeoutScript to EMPTY
  54.     set the timeoutLength to gDialogTimeout
  55.     set the timeoutScript to "goCloser"
  56.     if gAutoMode = 1 then
  57.       dialogOpen("d5")
  58.     else
  59.       dialogOpen("d5a")
  60.     end if
  61.   else
  62.     dialogClose()
  63.     set r to gDialogResult
  64.     set gDialogResult to EMPTY
  65.     set the timeoutScript to EMPTY
  66.     set the timeoutLength to 0
  67.     if r = "automatic" then
  68.       set gAutoMode to 1
  69.       set gTeaserMode to 0
  70.       clearTimeout()
  71.       if the movie = gMainMovieName then
  72.         clearMenuButtons()
  73.         selectSection("quick tour")
  74.       end if
  75.     else
  76.       if r = "interactive" then
  77.         set gAutoMode to 0
  78.         set gTeaserMode to 0
  79.         resetResellerTimeout()
  80.       else
  81.         if r = "restart" then
  82.           goCloser()
  83.           exit
  84.         end if
  85.       end if
  86.     end if
  87.   end if
  88. end
  89.  
  90. on exitDialog
  91.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength, gAutoMode, gResellerVersion, gLastScreen
  92.   if gDialogResult = EMPTY then
  93.     set gDialogCallback to "exitDialog"
  94.     set gDialogResult to EMPTY
  95.     set gLastTimeoutScript to the timeoutScript
  96.     set gLastTimeoutLength to the timeoutLength
  97.     set the timeoutScript to EMPTY
  98.     dialogOpen("d1")
  99.   else
  100.     dialogClose()
  101.     set r to gDialogResult
  102.     set gDialogResult to EMPTY
  103.     set the timeoutScript to EMPTY
  104.     set the timeoutLength to 0
  105.     if r = "exit" then
  106.       if gResellerVersion = 0 then
  107.         goCloser()
  108.       end if
  109.     end if
  110.     set the timeoutScript to gLastTimeoutScript
  111.     set the timeoutLength to gLastTimeoutLength
  112.   end if
  113. end
  114.  
  115. on scanDialog
  116.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gScanExitFlag, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength
  117.   if gDialogResult = EMPTY then
  118.     set gDialogCallback to "scanDialog"
  119.     set gDialogResult to EMPTY
  120.     set gLastTimeoutScript to the timeoutScript
  121.     set gLastTimeoutLength to the timeoutLength
  122.     set the timeoutScript to EMPTY
  123.     dialogOpen("d6")
  124.   else
  125.     dialogClose()
  126.     set r to gDialogResult
  127.     set gDialogResult to EMPTY
  128.     set the timeoutScript to EMPTY
  129.     set the timeoutLength to 0
  130.     if r = "exit" then
  131.       goCloser()
  132.       exit
  133.     else
  134.       if r = "scan" then
  135.         set gScanExitFlag to 3
  136.         goScan()
  137.         exit
  138.       end if
  139.     end if
  140.     set the timeoutScript to gLastTimeoutScript
  141.     set the timeoutLength to gLastTimeoutLength
  142.   end if
  143. end
  144.  
  145. on deleteFilesDialog
  146.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength
  147.   if gDialogResult = EMPTY then
  148.     set gDialogCallback to "deleteFilesDialog"
  149.     set gDialogResult to EMPTY
  150.     set gLastTimeoutScript to the timeoutScript
  151.     set gLastTimeoutLength to the timeoutLength
  152.     set the timeoutScript to EMPTY
  153.     dialogOpen("d2")
  154.   else
  155.     dialogClose()
  156.     set r to gDialogResult
  157.     set gDialogResult to EMPTY
  158.     set the timeoutScript to EMPTY
  159.     set the timeoutLength to 0
  160.     if r = "exit" then
  161.       doQuit()
  162.       exit
  163.     else
  164.       if r = "delete" then
  165.         deleteFilesDialog2()
  166.         exit
  167.       end if
  168.     end if
  169.     set the timeoutScript to gLastTimeoutScript
  170.     set the timeoutLength to gLastTimeoutLength
  171.   end if
  172. end
  173.  
  174. on deleteFilesDialog2
  175.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength
  176.   if gDialogResult = EMPTY then
  177.     set gDialogCallback to "deleteFilesDialog2"
  178.     set gDialogResult to EMPTY
  179.     set gLastTimeoutScript to the timeoutScript
  180.     set gLastTimeoutLength to the timeoutLength
  181.     set the timeoutScript to EMPTY
  182.     dialogOpen("d7")
  183.   else
  184.     dialogClose()
  185.     set r to gDialogResult
  186.     set gDialogResult to EMPTY
  187.     set the timeoutScript to EMPTY
  188.     set the timeoutLength to 5
  189.     if r = "exit" then
  190.       doQuit()
  191.       exit
  192.     end if
  193.     set the timeoutScript to gLastTimeoutScript
  194.     set the timeoutLength to gLastTimeoutLength
  195.     deleteFilesDialog()
  196.   end if
  197. end
  198.  
  199. on restartDialog
  200.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength, gResellerVersion
  201.   timeOutResellerDialog()
  202.   exit
  203.   if gDialogResult = EMPTY then
  204.     if gResellerVersion = 1 then
  205.       timeOutResellerDialog()
  206.       exit
  207.     end if
  208.     set gDialogCallback to "restartDialog"
  209.     set gDialogResult to EMPTY
  210.     set gLastTimeoutScript to the timeoutScript
  211.     set gLastTimeoutLength to the timeoutLength
  212.     set the timeoutScript to EMPTY
  213.     set the timeoutLength to gDialogTimeout
  214.     set the timeoutScript to "goCloser"
  215.     dialogOpen("d4")
  216.   else
  217.     dialogClose()
  218.     set r to gDialogResult
  219.     set gDialogResult to EMPTY
  220.     set the timeoutScript to EMPTY
  221.     set the timeoutLength to 0
  222.     if r = "exit" then
  223.       goCloser()
  224.       exit
  225.     else
  226.       if r = "restart" then
  227.         goRestart()
  228.         exit
  229.       end if
  230.     end if
  231.     set the timeoutScript to gLastTimeoutScript
  232.     set the timeoutLength to gLastTimeoutLength
  233.   end if
  234. end
  235.  
  236. on AutoDecisionDialog
  237.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength, gResellerVersion, gMainMovieName, gAutoMode, gTeaserMode
  238.   if gDialogResult = EMPTY then
  239.     set gDialogCallback to "AutoDecisionDialog"
  240.     set gDialogResult to EMPTY
  241.     set gLastTimeoutScript to the timeoutScript
  242.     set gLastTimeoutLength to the timeoutLength
  243.     set the timeoutScript to EMPTY
  244.     if gResellerVersion = 1 then
  245.       set the timeoutLength to gDialogTimeout
  246.       set the timeoutScript to "chooseTeaserDemo"
  247.     end if
  248.     dialogOpen("d5")
  249.   else
  250.     dialogClose()
  251.     set r to gDialogResult
  252.     set gDialogResult to EMPTY
  253.     if r = "interactive" then
  254.       set gAutoMode to 0
  255.       set gTeaserMode to 0
  256.       if gResellerVersion = 1 then
  257.         resetResellerTimeout()
  258.       else
  259.         set the timeoutScript to gLastTimeoutScript
  260.         set the timeoutLength to gLastTimeoutLength
  261.       end if
  262.       exit
  263.     else
  264.       if r = "restart" then
  265.         goRestart()
  266.         exit
  267.       else
  268.         set the timeoutScript to gLastTimeoutScript
  269.         set the timeoutLength to gLastTimeoutLength
  270.       end if
  271.     end if
  272.   end if
  273. end
  274.  
  275. on timeOutDialog
  276.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength
  277.   if gDialogResult = EMPTY then
  278.     set gDialogCallback to "timeOutDialog"
  279.     set gDialogResult to EMPTY
  280.     set gLastTimeoutScript to the timeoutScript
  281.     set gLastTimeoutLength to the timeoutLength
  282.     set the timeoutScript to EMPTY
  283.     set the timeoutLength to gDialogTimeout
  284.     set the timeoutScript to "goCloser"
  285.     dialogOpen("d5")
  286.   else
  287.     dialogClose()
  288.     set r to gDialogResult
  289.     set gDialogResult to EMPTY
  290.     set the timeoutScript to EMPTY
  291.     set the timeoutLength to 0
  292.     if r = "exit" then
  293.       goCloser()
  294.       exit
  295.     else
  296.       if r = "restart" then
  297.         goRestart()
  298.         exit
  299.       end if
  300.     end if
  301.     set the timeoutScript to gLastTimeoutScript
  302.     set the timeoutLength to gLastTimeoutLength
  303.   end if
  304. end
  305.  
  306. on endAutoDemoDialog
  307.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength, gResellerVersion
  308.   if gDialogResult = EMPTY then
  309.     set gDialogCallback to "endAutoDemoDialog"
  310.     set gDialogResult to EMPTY
  311.     set gLastTimeoutScript to the timeoutScript
  312.     set gLastTimeoutLength to the timeoutLength
  313.     set the timeoutScript to EMPTY
  314.     if gResellerVersion = 1 then
  315.       set the timeoutLength to gDialogTimeout
  316.       set the timeoutScript to "goCloser"
  317.     end if
  318.     dialogOpen("d3")
  319.   else
  320.     dialogClose()
  321.     set r to gDialogResult
  322.     set gDialogResult to EMPTY
  323.     set the timeoutScript to EMPTY
  324.     set the timeoutLength to 0
  325.     if r = "exit" then
  326.       exitDialog()
  327.       exit
  328.     else
  329.       if r = "restart" then
  330.         goRestart()
  331.         exit
  332.       end if
  333.     end if
  334.     set the timeoutScript to gLastTimeoutScript
  335.     set the timeoutLength to gLastTimeoutLength
  336.   end if
  337. end
  338.  
  339. on endAutoDemoDialogReseller
  340.   global gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gDialogWindow, gDialogResult, gDialogCallback, gLastTimeoutScript, gLastTimeoutLength, gResellerVersion
  341.   if gDialogResult = EMPTY then
  342.     set gDialogCallback to "endAutoDemoDialogReseller"
  343.     set gDialogResult to EMPTY
  344.     set gLastTimeoutScript to the timeoutScript
  345.     set gLastTimeoutLength to the timeoutLength
  346.     set the timeoutScript to EMPTY
  347.     if gResellerVersion = 1 then
  348.       set the timeoutLength to gDialogTimeout
  349.       set the timeoutScript to "goCloser"
  350.     end if
  351.     dialogOpen("d9")
  352.   else
  353.     dialogClose()
  354.     set r to gDialogResult
  355.     set gDialogResult to EMPTY
  356.     set the timeoutScript to EMPTY
  357.     set the timeoutLength to 0
  358.     if r = "menu" then
  359.       set gAutoMode to 0
  360.       set gTeaserMode to 0
  361.       resetResellerTimeout()
  362.       goMenu()
  363.       exit
  364.     else
  365.       if r = "restart" then
  366.         goRestart()
  367.         exit
  368.       end if
  369.     end if
  370.     set the timeoutScript to gLastTimeoutScript
  371.     set the timeoutLength to gLastTimeoutLength
  372.   end if
  373. end
  374.